<template>

  <el-popover placement="bottom"  trigger="click" @show="isShow=true" @hide="isShow=false">
    <kLine code="300869" isGt="1" :size="size" v-if="isShow" @setChartOption="setChartOption"></kLine>
    <el-button slot="reference" type="text"><slot></slot></el-button>
  </el-popover>

</template>

<script>
import kLine from "@/components/chart/kLine"

export default {
    components:{
        kLine
    },
    props:["size"],
    data() {
        return {
            isShow: false,
        }
    },


    mounted() {

    },
    computed:{
    },

    methods: {
        setChartOption(newoption){
            this.$emit("setChartOption",newoption)
        },
        showWin(){
            this.isShowWin = true;
            if(!this.isInit){
                this.isInit = true;
            }
            this.$nextTick(()=>{
                this.$refs.chartEl.reDraw();
            });
        },
        closeDialog(){
            this.isShowWin = false;
            this.$emit("close")
        },
        reDraw(){
            this.$nextTick(()=>{
                this.$refs.chartEl.reDraw();
            });
        }
    }
}
</script>
<style lang="less" scoped>



</style>


